# myproject/celery.py
from __future__ import absolute_import, unicode_literals
import os
from datetime import timedelta

from celery import Celery
from celery.schedules import crontab

os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'HopeIESystem.settings')

app = Celery('HopeIESystem')

# 从Django的设置文件中导入CELERY设置
app.config_from_object('django.conf:settings', namespace='CELERY')

# 自动发现并注册Django项目的所有Celery任务
app.autodiscover_tasks()
